package com.zz.ecommerce.searchManage.orderSearchQdc;

import com.alibaba.fastjson.JSONObject;
import com.zz.ecommerce.common.GridRequest;
import com.zz.ecommerce.common.GridResult;
import com.zz.ecommerce.common.bean.qdc.db.TGoodsListQdc;
import com.zz.ecommerce.common.bean.qdc.db.TOrderHeadQdc;
import com.zz.ecommerce.common.bean.qdc.db.TWaybillListQdc;
import com.zz.ecommerce.common.constants.TableConstants;
import com.zz.ecommerce.declareManage.common.dao.QdcOrderHeadDao;
import com.zz.ecommerce.declareManage.common.service.QdcOrderService;
import com.zz.ecommerce.utils.SessionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * Created by steven on 2016/3/28.
 */
@Controller
@RequestMapping("/searchManage/orderSearchQdc")
public class QdcOrderController {

    @Autowired
    private QdcOrderHeadDao orderHeadDao;

    @Autowired
    private QdcOrderService orderService;

    @RequestMapping("/init")
    public String init() {
        return "searchManage/orderManageQdc/index";
    }

    @RequestMapping("/queryOrderList")
    @ResponseBody
    public GridResult queryOrderList(TOrderHeadQdc orderHead, GridRequest request, HttpSession session) {
//        orderHead.setOperId(SessionUtil.getOperator(session));
        orderHead.setOrgId(SessionUtil.getOrganizationId(session));
        return orderService.queryOrderList(request, orderHead);
    }
}
